package cn.jeasy.sample.dao;

import java.util.List;

import cn.jeasy.core.jdbc.annotation.Delete;
import cn.jeasy.core.jdbc.annotation.Insert;
import cn.jeasy.core.jdbc.annotation.Param;
import cn.jeasy.core.jdbc.annotation.Select;
import cn.jeasy.core.jdbc.annotation.Update;
import cn.jeasy.sample.entity.User;


public interface UserMapper {
	
	@Insert("insert user (username,password,createtime,updatetime) value(#{username},#{password},now(),now())")
	public int insert(User u); 

	@Update("update user  set username=#{username},password=#{password},updatetime=now() where id=#{id}")
   public int update(User u); 

	@Delete("delete from user  where id=#{id}")
	public int delete(User u); 

    @Select("select username,password,createtime,updatetime from user where id=#{id}")
	public User get(@Param("id") int id);  

    @Select("select username,password,createtime,updatetime from user where id=#{id}")
	public List<User> find(User u);  
}
